import http from '@/utils/http'
const env = import.meta.env
const BASE_URL = env.PROD ? `${env.VITE_API_BASE_URL}/api` : '/api'
const BASE_URL2 = env.PROD ? `${env.VITE_API_BASE_URL4}/admin` : '/fulu'

/** @desc 登录 */
export function login(data: any) {
  return http.post(`${BASE_URL}/auth/login`, data)
}

/** @desc 获取验证码图片 */
export function captcha() {
  return http.get(`${BASE_URL}/captcha`)
}

/* 用户 - 列表 */
export const userList = (data: any) => {
  return http.get(`${BASE_URL}/v1/user/lists`, data)
}

/* 用户 - 会员等级 */
export const userRankList = (data: any) => {
  return http.get(`${BASE_URL}/v1/userRank/lists`, data)
}

/* 用户 - 淘宝推广账户 */
export const unionAccountTbList = (data: any) => {
  return http.get(`${BASE_URL}/v1/unionAccount/tbList`, data)
}

/* 用户 - 拼多多推广账户 */
export const unionAccountPddList = (data: any) => {
  return http.get(`${BASE_URL}/v1/unionAccount/pddList`, data)
}

/* 用户 - 全部会员数量详情 */
export const userCountDetail = (data: any) => {
  return http.get(`${BASE_URL}/v1/user/countDetail`, data)
}

/* 用户 - 收益详情 */
export const userCommissionDetail = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/userCommissionDetail`, data)
}

/* 用户 - 基础信息 */
export const userDetail = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/detail`, data)
}

/* 用户 - 通过邀请码查询用户ID */
export const getUserIdByInviteCode = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/convertToUserId`, data)
}

/* 用户 - 粉丝信息 */
export const userFans = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/fans`, data)
}

/* 用户 - 订单信息 */
export const userOrder = (data: any) => {
  return http.post(`${BASE_URL}/v1/order/esLists`, data)
}

/* 用户 - 佣金信息 */
export const userCommission = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/commission`, data)
}

/* 用户 - 提现记录 */
export const userWithdrawal = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/withdrawal`, data)
}

/* 用户 - 修改用户信息 */
export const userUpdate = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/update`, data)
}

/* 用户 - 上传头像 */
export const userAvatar = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/userAvatar`, data)
}

/* 用户 - 上传微信二维码 */
export const userWxQrcode = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/userWxQrcode`, data)
}

/* 用户 - 删除拼多多授权 */
export const userDeletePddGrant = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/deletePddGrant`, data)
}

/* 用户 - 开通大班长 */
export const userUpgradeMonitor = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/upgradeMonitor`, data)
}

/* 用户 - 开通总代 */
export const userUpgradeOperate = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/upgradeOperate`, data)
}

/* 用户 - 修改手机号 */
export const userUpdateUserMobile = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/updateUserMobile`, data)
}

/* 用户 - 回复零元购机会 */
export const userAddFreeGoods = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/addFreeGoods`, data)
}

/* 用户 - 删除注销会员 */
export const userDel = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/delete`, data)
}

/* 用户 - 佣金记录 */
export const userCommissionRecords = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/commissionRecords`, data)
}

/* 用户 - 淘宝删除授权 */
export const userDeleteTbGrant = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/deleteTbGrant`, data)
}

/* 用户 - 重置京东授权 */
export const userResetJdGrantNum = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/resetJdGrantNum`, data)
}

/* 用户 - 删除会员 */
export const userDelete = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/delete`, data)
}

/* 用户 - 新用户统计 */
export const everyDayNewUser = (data: any) => {
  return http.get(`${BASE_URL}/v1/statistics/userStatistic/everyDayNewUser`, data)
}

/* 用户 - 新用户统计导出 */
export const everyDayNewUserExport = (data: any) => {
  return http.get(`${BASE_URL}/v1/statistics/userStatistic/everyDayNewUserExport`, data, {}, 'blob')
}

/* 用户 - 新用户统计 */
export const everyDayDetail = (data: any) => {
  return http.post(`${BASE_URL}/v1/statistics/userStatistic/everyDayDetail`, data)
}

/* 淘礼金 - 会员列表 */
export const tljUserLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/tljUser/lists`, data)
}

/* 淘礼金 - 会员新增 */
export const tljUserAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/tljUser/add`, data)
}

/* 淘礼金 - 会员修改 */
export const tljUserUpdate = (data: any) => {
  return http.post(`${BASE_URL}/v1/tljUser/update`, data)
}

/* 淘礼金 - 资金记录 */
export const tljAccountRecordLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/tljAccountRecord/lists`, data)
}

/* 淘礼金 - 礼金记录 */
export const tljGiftLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/tljGift/lists`, data)
}

/* 淘礼金 - 系统充值 */
export const tljSystemRechargeAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/tljSystemRecharge/add`, data)
}

/* 淘礼金 - 会员统计 */
export const tljUserStatistic = (data: any) => {
  return http.get(`${BASE_URL}/v1/tljUser/statistic`, data)
}

/* 新版礼金 - 会员列表 */
export const giftActivityList = (data: any) => {
  return http.get(`${BASE_URL}/v1/giftActivity/lists`, data)
}

/* 新版礼金 - 会员编辑 */
export const giftActivityEdit = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/update`, data)
}

/* 新版礼金 - 会员新增 */
export const giftActivityAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/add`, data)
}

/* 新版礼金 - 会员批量新增 */
export const giftActivityBatchAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/batchAdd`, data)
}

/* 新版礼金 - 资金记录 */
export const giftActivityAccountRecord = (data: any) => {
  return http.get(`${BASE_URL}/v1/giftActivity/accountRecordLists`, data)
}

/* 新版礼金 - 充值 */
export const giftActivitySystemRecharge = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/systemRecharge`, data)
}

/* 新版礼金 - 会员统计 */
export const giftActivityStatistic = (data: any) => {
  return http.get(`${BASE_URL}/v1/giftActivity/statistic`, data)
}

/* 新版礼金 - 商品管理 - 列表*/
export const giftActivityGoodList = (data: any) => {
  return http.get(`${BASE_URL}/v1/giftActivityRecommendGood/lists`, data)
}

/* 新版礼金 - 商品管理- 添加 */
export const giftActivityGoodAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivityRecommendGood/add`, data)
}

/* 新版礼金 - 商品管理- 编辑 */
export const giftActivityGoodEdit = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivityRecommendGood/update`, data)
}

/* 新版礼金 - 商品管理- 删除 */
export const giftActivityGoodDelete = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivityRecommendGood/delete`, data)
}

/* 新版礼金 - 商品管理- 礼金记录 */
export const giftActivityGiftLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/giftActivity/giftLists`, data)
}

/** 导出礼金记录 */
export function accountRecordListsExport(params: any) {
  return http.get(`${BASE_URL}/v1/giftActivity/accountRecordListsExport`, params, {}, 'blob')
}

/* 平台礼金 - 列表 */
export const giftActivityPlatformList = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/platform/searchList`, data)
}

/* 平台礼金 - 创建 */
export const giftActivityPlatformAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/platform/create`, data)
}

/* 平台礼金 - 更新 */
export const giftActivityPlatformEdit = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/platform/update`, data)
}

/* 平台礼金 - 详情 */
export const giftActivityPlatformDetail = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/platform/detail`, data)
}

/* 平台礼金 - 删除 */
export const giftActivityPlatformDelete = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/platform/del`, data)
}

/* 平台礼金 - 统计对账 */
export const giftActivityPlatformStatistic = (data: any) => {
  return http.post(`${BASE_URL}/v1/giftActivity/statistic`, data)
}

/* 商学院  - 分类 */
export const schoolCate = (data: any) => {
  return http.get(`${BASE_URL}/v1/school/categories`, data)
}

/* 商学院  - 列表 */
export const schoolLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/school/lists`, data)
}

/* 商学院  - 新增  */
export const schoolAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/school/add`, data)
}

/* 商学院  - 修改  */
export const schoolUpdate = (data: any) => {
  return http.post(`${BASE_URL}/v1/school/update`, data)
}

/* 商学院  - 删除  */
export const schoolDel = (data: any) => {
  return http.post(`${BASE_URL}/v1/school/delete`, data)
}

/* 商学院  - 上传图片  */
export const uploadSchool = (data: any) => {
  return http.post(`${BASE_URL}/v1/upload/school`, data)
}

/* 商学院  - 切换显示热门  */
export const schoolToggle = (data: any) => {
  return http.post(`${BASE_URL}/v1/school/toggle`, data)
}

/* 商学院  - 详情  */
export const schoolDetail = (data: any) => {
  return http.get(`${BASE_URL}/v1/school/detail`, data)
}

/* 商学院  - 上传视频  */
export const uploadSchoolVideo = (data: any) => {
  return http.post(`${BASE_URL}/v1/upload/schoolVideo`, data)
}

/* 商学院  - 编辑器上传图片  */
export const uploadeEditorImage = (data: any) => {
  return http.post(`${BASE_URL}/v1/upload/editorImage`, data)
}

/* 商学院  - 文章搜索（包含分类+关键字）  */
export const schoolSearch = (data: any) => {
  return http.post(`${BASE_URL}/v1/school/getCategoryKeywordArticleList`, data)
}

/* 商学院分类  - 列表  */
export const schoolCateLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/schoolCategory/lists`, data)
}

/* 商学院分类  - 新增  */
export const schoolCateAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolCategory/add`, data)
}

/* 商学院分类  - 修改  */
export const schoolCateUpdate = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolCategory/update`, data)
}

/* 商学院分类  - 切换显示  */
export const schoolCateToggle = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolCategory/toggle`, data)
}

/* 商学院分类  - 删除  */
export const schoolCateDel = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolCategory/delete`, data)
}

/* 商学院分类  - 详情  */
export const schoolCateDetail = (data: any) => {
  return http.get(`${BASE_URL}/v1/schoolCategory/detail`, data)
}

/* 商学院金刚区  - 列表  */
export const schoolJgqLists = (data: any) => {
  return http.get(`${BASE_URL}/v1/schoolJgq/lists`, data)
}

/* 商学院金刚区  - 详情  */
export const schoolJgDetail = (data: any) => {
  return http.get(`${BASE_URL}/v1/schoolJgq/detail`, data)
}

/* 商学院金刚区  - 修改  */
export const schoolJgqUpdate = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolJgq/update`, data)
}
/* 商学院金刚区  - 修改  */
export const schoolJgqAdd = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolJgq/add`, data)
}

/* 商学院金刚区  - 切换显示  */
export const schoolJgqCateToggle = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolJgq/toggle`, data)
}

/* 商学院金刚区  - 删除  */
export const schoolJgqCateDel = (data: any) => {
  return http.post(`${BASE_URL}/v1/schoolJgq/delete`, data)
}

/* 优惠爆料  - 分类 - 添加/编辑  */
export const goodsTypeAdd = (data: any) => {
  return http.post(`${BASE_URL2}/goods/type/append`, data)
}

/* 优惠爆料  - 分类 - 状态  */
export const goodsTypeToggle = (data: any) => {
  return http.post(`${BASE_URL2}/goods/type/setOnLine`, data)
}

/* 优惠爆料  - 分类 - 列表  */
export const goodsTypeList = (data: any) => {
  return http.post(`${BASE_URL2}/goods/type/list`, data)
}

/* 优惠爆料  - 分类 - 删除  */
export const goodsTypeDel = (data: any) => {
  return http.post(`${BASE_URL2}/goods/type/del`, data)
}

/* 优惠爆料  - 分类 - 排序  */
export const goodsTypeSort = (data: any) => {
  return http.post(`${BASE_URL2}/goods/type/sort`, data)
}

/* 优惠爆料  - 标签 - 添加/编辑  */
export const goodsTagAdd = (data: any) => {
  return http.post(`${BASE_URL2}/goods/tag/append`, data)
}

/* 优惠爆料  - 标签 - 列表  */
export const goodsTagList = (data: any) => {
  return http.post(`${BASE_URL2}/goods/tag/list`, data)
}

/* 优惠爆料  - 商品 - 获取商品信息  */
export const goodsRevelationGetGoodsInfo = (data: any) => {
  return http.post(`${BASE_URL2}/goods/revelation/getGoodsInfo`, data)
}

/* 优惠爆料  - 商品 - 添加/编辑  */
export const goodsRevelationGetAdd = (data: any) => {
  return http.post(`${BASE_URL2}/goods/revelation/append`, data)
}

/* 优惠爆料  - 商品 - 列表  */
export const goodsRevelationGetList = (data: any) => {
  return http.post(`${BASE_URL2}/goods/revelation/list`, data)
}

/* 优惠爆料  - 商品 - 置顶  */
export const goodsRevelationSetTop = (data: any) => {
  return http.post(`${BASE_URL2}/goods/revelation/setTop`, data)
}

/* 优惠爆料  - 商品 - 删除  */
export const goodsRevelationDel = (data: any) => {
  return http.post(`${BASE_URL2}/goods/revelation/del`, data)
}

/* 用户排行榜  - 拉新排行  */
export const statUserInviteRank = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/inviteRank`, data)
}

/* 用户排行榜  - 根据文件获取邀请码  */
export const getInviteCodesByFile = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/getInviteCodesByFile`, data)
}

/* 用户排行榜  - GMV排行  */
export const statUserPayPriceRank = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/payPriceRank`, data)
}

/* 用户排行榜  - 佣金结算排行  */
export const statUserCommissionRank = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/commissionRank`, data)
}

/* 用户排行榜  - 导出排行数据  */
export const rankExport = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/rankExport`, data, {}, 'blob')
}

/* 用户排行榜  - 导出排行  */
export const statUserRankExport = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/rankExport`, data, {}, 'blob')
}

/* 用户分析  - 新用户留存  */
export const userPreserveData = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/userPreserveData`, data)
}

/* 用户分析  - 版本分布  */
export const versionData = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/versionData`, data)
}

/* 用户分析  - 地区分布  */
export const addressData = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/addressData`, data)
}

/* 用户统计  - 团队对比  */
export const teamContrastList = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/teamContrastList`, data)
}

/* 用户统计  - 平台对比  */
export const platformContrastList = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/platformContrastList`, data)
}

/* 用户统计  - 收益对比  */
export const commissionContrastList = (data: any) => {
  return http.post(`${BASE_URL}/v1/stat/user/commissionContrastList`, data)
}

/* 同步平台授权到云  */
export const syncPlatformGrantToCloud = (data: any) => {
  return http.post(`${BASE_URL}/v1/user/syncPlatformGrantToCloud`, data)
}
